package com.management.service.Impl;

import com.management.dao.MaterialsRecordDao;
import com.management.dao.MaterialsTypeDao;
import com.management.po.MaterialsRecord;
import com.management.service.MaterialsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author XS
 * 仓库记录业务逻辑实现类接口
 * @version 1.0
 */
import java.util.List;

/**
 * @author XS
 * 仓库记录业务逻辑实现类
 * @version 1.0
 */
@Service
public class MaterialsRecordServiceImpl implements MaterialsRecordService {
    @Autowired
    MaterialsRecordDao materialsRecordDao;
    @Override
    public List<MaterialsRecord> findAll() {
        return materialsRecordDao.findAll();
    }

    @Override
    public MaterialsRecord findByMaterialsRecordId(int materialsRecordId) {
        return materialsRecordDao.findByMaterialsRecordId(materialsRecordId);
    }

    @Override
    public List<MaterialsRecord> findByWarehouseId(int warehouseId) {
        return materialsRecordDao.findByWarehouseId(warehouseId);
    }

    @Override
    public List<MaterialsRecord> findByMaterialsId(int materialsId) {
        return materialsRecordDao.findByWarehouseId(materialsId);
    }

    @Override
    public boolean add(MaterialsRecord materialsRecord) {
        return materialsRecordDao.add(materialsRecord)<0?true:false;
    }

    @Override
    public boolean update(MaterialsRecord materialsRecord) {
        return materialsRecordDao.update(materialsRecord)>0?true:false;
    }

    @Override
    public boolean delete(int[] arrays) {
        return materialsRecordDao.delete(arrays)>0?true:false;
    }
}
